<?php

namespace app\index\controller;

use app\common\controller\Basecontroller;
use app\index\model\Classification;
use app\index\model\Company;
use app\index\model\Official;
use app\index\model\User;
use think\Request;

class Home extends Basecontroller {
    /**
     * 显示职位分类，职位，引用official模型中的方法，输出相应的code
     * @copyright hyw (接口未完善)
     * @return \think\response\Json
     */
    public function disOff(Official $official) {
        return $this->returnJson(self::OK,'输出成功',$official->getClassOAttr());
    }

    /**
     * 显示热门职位接口：从职位表查询中获取数据，输出相应的code
     * @copyright hyw (接口未完善)
     * @return \think\response\Json
     */
    public function hotJob(Official $official) {
        return $this->returnJson(self::OK,'输出成功',$official->getHotJobAttr());
    }

    /**
     * 显示热门公司接口：从公司表查询中获取数据，输出相应的code
     * @copyright hyw
     * @return \think\response\Json
     */
    public function hotCompany(Company $company) {
        return $this->returnJson(self::OK,'输出成功',$company->getHotCompanyAttr());
    }

    /**
     * 选择分类职位接口
     * @copyright hyw
     * @param Request $request
     * @param Classification $classtion
     * @return \think\response\Json
     */
    public function choseJob(Request $request,Classification $classtion) {
        $class = $request->param('class');
        return $this->returnJson(self::OK,'输出成功',$classtion->getChoseAttr($class));
    }

}